<!--
 * @Autor: Haiting Zhao
 * @Date: 2021-10-26 16:47:18
 * @LastEditors: Haiting Zhao
 * @LastEditTime: 2021-12-19 13:15:20
 * @Description: file content
 * @FilePath: \Management-of-Scientific-Research-in-Universities-Front\src\components\menu\Permission.vue
-->
<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right" style="margin-bottom:10px">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>查看权限</el-breadcrumb-item>
    </el-breadcrumb>
    <el-tree :data="permissionList" :props="defaultProps" default-expand-all @node-click="handleNodeClick" />
  </div>

</template>

<script>
import axios from 'axios'
export default {
  name: 'Permission',
  data() {
    return {
      permissionList: [],
      defaultProps: {
        children: 'sonPermissions',
        label: 'permissionName'
      }
    }
  },
  mounted() {
    this.getpermissionList()
  },
  methods: {
    handleNodeClick(data) {
      // console.log(data)
    },
    getpermissionList() {
      axios.get('/rolePer/allPermission')
        .then(res => {
          this.permissionList = res.data.data
        })
        .catch(err => {
          console.error(err)
        })
    }
  }
}
</script>
